<!doctype html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<link href="../css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="../iconfont/iconfont.css">
	<style type="text/css">
		.mui-segmented-control.mui-scroll-wrapper {
			height: initial;
			height: 80px;
		}
		
		.mui-segmented-control.mui-scroll-wrapper .mui-scroll {
			height: 80px;
		}
		
		.mui-fullscreen {
			position: initial;
			background-color: #EFEFF4;
		}
		
		.mui-segmented-control.mui-scroll-wrapper .mui-control-item {
			padding: 0 18px;
		}
		
		
		.mui-content-padded {
			background-color: #EFEFF4 margin:initial;
			padding: 10px;
		}
		
		#content01 {
			position: fixed;
			top: 44px;
			z-index: 5;
		}
		
		.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body {
			color: #8f8f94;
		}
		.mui-table-view.mui-grid-view{
			padding:7px 10px 25px 0;
		}
		.mui-title {
			color: white;
		}
		
		.mui-text-center {
			color: #DD524D;
		}
		
		.mui-icon-refreshempty:before {
			color: white;
		}
		
		.iconfontItem {
			font-family: "iconfont" !important;
			font-size: 48px;
			font-style: normal;
			-webkit-font-smoothing: antialiased;
			-moz-osx-font-smoothing: grayscale;
			color: #4ec2f0;
		}
		
		#grid>.mui-table-view-cell {
			border: 0.5px solid #eee;
		}
		.mui-icon-refresh:before{
			color:white;
		}
		.iconColor{
			color:#F0AD4E;
		}
		.mui-icon-back:before, .mui-icon-left-nav:before{
			color:white;
		}
	</style>
</head>
<body>
<!--头部内容-->
	<!--<header class="mui-bar mui-bar-nav">-->
		<!--<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>-->
		<!--&lt;!&ndash;<a class=" mui-icon mui-icon-refreshempty mui-pull-right"></a>&ndash;&gt;-->
		<!--<h1 class="mui-title">站点名称</h1>-->
	<!--</header>-->
	<!--上数下文-->
	<div class="mui-table-view mui-grid-view" id="content">
		<div class="mui-table-view-cell mui-media mui-col-xs-4">
			<a>
				<span class="mui-text-center" id="faultNumber">--</span>
				<div class="mui-media-body g">故障告警</div>
			</a>
		</div>
		<div class="mui-table-view-cell mui-media mui-col-xs-4">
			<a>
				<span class="mui-text-center" id="orderNumber">--</span>
				<div class="mui-media-body g">运维工单</div>
			</a>                        
		</div>
		<div class="mui-table-view-cell mui-media mui-col-xs-4">
			<a>
				<span class="mui-text-center" id="loopNumber">--</span>
				<div class="mui-media-body g">监控回路</div>
			</a>
		</div>
	</div>

<!--主体内容-->
	<div class="mui-content mui-row">	
		<ul class="mui-table-view mui-grid-view mui-grid-9" id="grid">
			<li id="FZsiteName" class="mui-table-view-cell mui-media mui-col-xs-4" >
				<a>
					<span class="iconfontItem mui-icon">&#xe68f;</span>
					<div class="mui-media-body">站点概览</div>
				</a>
			</li>
			<li id="svg" class="mui-table-view-cell mui-media mui-col-xs-4" id="system">
				<!--<a href="../svg.html">-->
				<a>
					<span class="iconfontItem mui-icon">&#xe671;</span>
					<div class="mui-media-body">主系统图</div>
				</a>
			</li>
			<li id="monitoring" class="mui-table-view-cell mui-media mui-col-xs-4">
				<a>
					<span class="iconfontItem mui-icon">&#xe621;</span>
					<div class="mui-media-body">用电监测</div>
				</a>
			</li>
			<li id = "analyze" class="mui-table-view-cell mui-media mui-col-xs-4">
				<a>
					<span class="iconfontItem mui-icon">&#xe714;</span>
					<div class="mui-media-body">用电分析</div>
				</a>
			</li>
			<li class="mui-table-view-cell mui-media mui-col-xs-4">
				<a>
					<span class="iconfontItem mui-icon">&#xe61c;</span>
					<div class="mui-media-body">故障告警</div>
				</a>
			</li>
			<li id = "management" class="mui-table-view-cell mui-media mui-col-xs-4">
				<a>
					<span class="iconfontItem mui-icon">&#xe605;</span>
					<div class="mui-media-body">运维管理</div>
				</a>
			</li>
			<li id="surveillanceVideo" class="mui-table-view-cell mui-media mui-col-xs-4">
				<a>
					<span class="iconfontItem mui-icon">&#xe6af;</span>
					<div class="mui-media-body">视屏监控</div>
				</a>
			</li>
			<!--<li class="mui-table-view-cell mui-media mui-col-xs-4">
				<a href="parameter.html">
					<span class="iconfontItem mui-icon">&#xe614;</span>
					<div class="mui-media-body">设备台账</div>
				</a>
			</li>-->
			<li id="archives" class="mui-table-view-cell mui-media mui-col-xs-4">
				<a>
					<span class="iconfontItem mui-icon">&#xe600;</span>
					<div class="mui-media-body">站点档案</div>
				</a>
			</li>
			<li id="xuliang" class="mui-table-view-cell mui-media mui-col-xs-4">
				<a>
					<span class="iconfontItem mui-icon">&#xe6df;</span>
					<div class="mui-media-body">需量分析</div>
				</a>
			</li>
			<!--<li class="mui-table-view-cell mui-media mui-col-xs-4">
				<a>
					<span class="iconfontItem mui-icon">&#xe6df;</span>
					<div class="mui-media-body">综合月报</div>
				</a>
			</li> -->
			<!--<li class="mui-table-view-cell mui-media mui-col-xs-4">
				<a href="announcement.html">
					<span class="iconfontItem mui-icon">&#xe66b;</span>
					<div class="mui-media-body">系统公告</div>
				</a>
			</li>-->
			<!--<li class="mui-table-view-cell mui-media mui-col-xs-4">
				<a>
					<span class="iconfontItem mui-icon iconColor">&#xe636;</span>
					<div class="mui-media-body">新增</div>
				</a>
			</li>-->
		</ul>
	</div>
</body>
<script src="../js/mui.min.js"></script>
<script src="../js/common.js"></script>
<script src="../js/ZNative.js"></script>
<script type="text/javascript">

	WebOS.OnReadly(function(args){
	
		var json = JSON.parse(args);
		var dcsId = json.stationId;
		var token = json.token;
		var fileUrl = json.fileUrl;

		WebOS.setItem({Key:'token',Value:token});
		WebOS.setItem({Key:'dcsId',Value:dcsId});
		WebOS.setItem({Key:'fileUrl',Value:fileUrl});

		
		//请求每个站点的告警和工单的数据
  		mui.ajax(getUrl +'appDcsView/getStoStationGlobalView', {
				data: {
					sysId:sysId,
					sid:dcsId,
					token:token
				},
				dataType: 'json', //服务器返回json格式数据
				type: 'get', //HTTP请求类型
				headers: {
					'Content-Type': 'application/x-www-form-urlencoded'
				},
				success: function(json){
					
					if(json.tokenFlag == false) {
						mui.alert(json.msg);
						//		记得每个页面都要有这个判断						
					} else {
						console.log(JSON.stringify(json));
						for(var i=0;i<json.length;i++){
							if(json[i]!=null){
								var faultNumber = json[0].stoStationErrNum; //报警数量
								
						   		var loopNumber = json[0].stoStationLine;//监测回路
						   		if(faultNumber!=null){
		                        	document.querySelector("#faultNumber").innerHTML=faultNumber;
		                        };
		                        if(loopNumber!=null){
		                        	document.querySelector("#loopNumber").innerHTML=loopNumber;
		                        }
		                   }
						}   	
					}
				//遍历请求回来的数据并判断是否为空不为空就插入动态数据
				},
				error: function(e) {
					
				}
		});

		
		mui.ajax(getUrl + 'appDclElcMonitor/getDclLineList',{
				data: {
					sysId:sysId,
					sid:dcsId,
					token:token 
				},
				dataType: 'json', //服务器返回json格式数据
				type: 'post', //HTTP请求类型
				headers: {
					'Content-Type': 'application/x-www-form-urlencoded'
				},
				success: function(json){
					if(json.tokenFlag == false) {
						mui.alert(json.msg);
						//		记得每个页面都要有这个判断						
					} else {
						var dclId;
						var loopNumber = json.total;//监测回路
						if(loopNumber!=null){
                        	document.querySelector("#loopNumber").innerHTML=loopNumber;
                        }
					}
					
				},
				error: function(e) {
				
				}
		});
		
		

		//站点概览
		mui("#FZsiteName").on('tap','a',function(){
			WebOS.openWebView({
								title:"站点概览",
								url:"FZsiteName.html",
								args:{}
							});
		})


		//svg一次图
		mui("#svg").on('tap','a',function(){
			WebOS.openWebViewWithCfg({
				title:"",
				url:"svg.html",
				args:{},
				webcfg:{used_titlebar:'no',used_pressbar:'yes'}
			});

		})
		
		//检测点列表
		mui("#monitoring").on('tap','a',function(){
			WebOS.openWebView({
								title:"检测点列表",
								url:"dclList.html",
								args:{stationId:dcsId,type:'1'}
							});
		})


		//用电分析
		mui("#analyze").on('tap','a',function(){
			WebOS.openWebView({
								title:"用电分析",
								url:"analyze.html",
								args:{}
							});
		})

		//站点档案
		mui("#archives").on('tap','a',function(){
			WebOS.openWebView({
								title:"站点档案",
								url:"archives.html",
								args:{}
							});
		})

		//运维管理
		mui("#management").on('tap','a',function(){
			WebOS.openWebView({
								title:"运维管理",
								url:"management.html",
								args:{}
							});
		})

		//视频监控
		mui("#surveillanceVideo").on('tap','a',function(){
			WebOS.openWebView({
								title:"视频监控",
								url:"surveillanceVideo.html",
								args:{}
							});
		})

		//检测点列表
		mui("#xuliang").on('tap','a',function(){
			WebOS.openWebView({
								title:"检测点列表",
								url:"dclList.html",
								args:{stationId:dcsId,type:'2'}
							});
		})
		
		
		
		
		
	
	});
	
	
</script>
</html>